Release 10.1A: OpenEdge Data Management:
SQL Reference
Date arithmetic expressions
Date arithmetic expressions compute the difference between date-time expressions in terms of days or milliseconds. SQL supports these forms of date arithmetic:
This is the syntax for a date arithmetic expression:
date_time_exprReturns a value of type
DATEorTIMEorTIMESTAMP. A single date-time expression cannot mix data types, however. All elements of the expression must be the same data type.Date-time expressions can contain date-time literals, but they must be converted to
DATEorTIMEusing theCAST,CONVERT, orTO_DATEfunctions.int_exprReturns an integer value. SQL interprets the integer differently depending on the data type of the date-time expression:
ExamplesThe following example manipulates
DATEvalues using date arithmetic. SQL interprets integers as days and returns date differences in units of days:
The following example manipulates
TIMEvalues using date arithmetic. SQL interprets integers as milliseconds and returns time differences in milliseconds:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |